Dynamic `import()` with module aliases

  $ . ./setup.sh

  $ cat > dune-project <<EOF
  > (lang dune 3.9)
  > (using melange 0.1)
  > EOF

  $ cat > dune <<EOF
  > (melange.emit
  >  (target out)
  >  (preprocess (pps melange.ppx))
  >  (emit_stdlib false))
  > EOF

  $ cat > source.ml <<EOF
  > let x = 1
  > EOF
  $ cat > with_alias.ml <<EOF
  > let x = 2
  > module The_source = Source
  > EOF
  $ cat > x.ml <<EOF
  > module type The_sig = module type of With_alias
  > module type Src = module type of With_alias.The_source
  > let foo () =
  >   Js.import (module With_alias : The_sig)
  >   |> Js.Promise.then_ (fun (module The_import: The_sig) ->
  >     Js.log2 "the alias" The_import.x;
  >     Js.Promise.resolve ())
  > let bar () =
  >   Js.import With_alias.The_source.x
  >   |> Js.Promise.then_ (fun x ->
  >     Js.log2 "the aliased x" x;
  >     Js.Promise.resolve ())
  > let (_: _ Js.Promise.t) =
  >   bar ()
  >   |> Js.Promise.then_ foo
  > EOF

  $ dune build @melange

  $ cat _build/default/out/x.js
  // Generated by Melange
  'use strict';
  
  
  function foo(param) {
    return import("./with_alias.js").then(function (The_import) {
      console.log("the alias", The_import.x);
      return Promise.resolve();
    });
  }
  
  function bar(param) {
    return import("./source.js").then(function (m) {
      return m.x;
    }).then(function (x) {
      console.log("the aliased x", x);
      return Promise.resolve();
    });
  }
  
  bar().then(foo);
  
  module.exports = {
    foo,
    bar,
  }
  /*  Not a pure module */

  $ node _build/default/out/x.js
  the aliased x 1
  the alias 2
